package stdio.costa.imoca.converter;

import java.util.List;

import stdio.costa.imoca.dto.PostcardBackListDTO;
import stdio.costa.imoca.model.PostcardBack;

public class PostcardBacks2PostcardBackListWrapper {

	public static PostcardBackListDTO convert(List<PostcardBack> postcardBacks) {

		if (postcardBacks == null) {
			return new PostcardBackListDTO();
		}

		PostcardBackListDTO wrapper = new PostcardBackListDTO();

		wrapper.setPostcardBacks(postcardBacks);
		wrapper.setTotalNumber(postcardBacks.size());

		return wrapper;
	}
}
